package com.mine.dao;

import com.mine.pojo.Order;
import com.mine.pojo.OrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface OrderMapper {

    //增加订单
    boolean addOrder(@Param("user_id") int user_id, @Param("money") String money, @Param("order") Order order);


    OrderItem queryOrderItemByUserByMeal(@Param("meal_id") int meal_id, @Param("user_id") int user_id);

    void addOrderItem(@Param("meal_id") int meal_id, @Param("user_id") int user_id);

    void updateOrderItem(int meal_id, int user_id);

    List<OrderItem> queryAllOrderItemByUser(int user_id);

    void reduceOrderItemNum(@Param("meal_id") int meal_id, @Param("user_id") int user_id);

    void deletemealcart(@Param("meal_id") int meal_id, @Param("user_id") int user_id);

    void updateOrderItemByState(Integer user_id);

    Order findOrderLastById(Integer order_id);

    void paySuccess(String order_id);

    List<Order> queryOrderByUserId(@Param("user_id") Integer user_id, @Param("state") String state);

    void overOrder(Integer order_id);

    void deleteOrderItem(Integer order_id);

    void updateOrderItemByOrder(@Param("order_id") Integer order_id, @Param("user_id") Integer user_id);

    List<OrderItem> queryAllOrderItemByOrder(String order_id);

    Order queryOrderById(String order_id);

    OrderItem getOrderitemById(String orderitem_id);

    List<Order> adminOrderList(String order_state);

    void updateMealSize(Integer meal_id);

    void updateOrdershopstate(String order_id);

    void updateOrdershopstate1(String order_id);
}
